<template>
  <div class="head">
    <div class="h-top" v-if="flag">
      <img src="@assets/image/advertising1.jpg" alt="">
      <van-icon class="iconfont" class-prefix="icon" name="chahao" id="chahao" @click="clear" />
    </div>
    <div class="h-con">
      <div class="head-left" @click="enter">
        <van-icon class="iconfont" class-prefix="icon" name="category" />
        <span>分类</span>
      </div>
      <div class="head-conter">
        <img src="@assets/image/160309264160285518.gif" alt="">
      </div>
      <div class="head-right">
        <van-icon class="iconfont" class-prefix="icon" name="login" />
        <span>登录</span>
      </div>
      <div class="head-bottom" @click="enterSearch">
        <van-icon class="iconfont" class-prefix="icon" name="fangdajing" color="#ccc" size="25" />
        <span>疯抢199减100神劵</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return{
      flag: true
    }
  },
  methods: {
    enter () {
      this.$router.push('./cates')
    },
    // 点击到搜索页
    enterSearch () {
      this.$router.push('/Search')
    },
    clear(){
      this.flag = false
    }
  },
}
</script>

<style lang="scss" scoped>
.head {
  width: 100%;
  height: 200px;
  border-radius: 0 0 30px 30px;
  background-color: rgb(255, 219, 71);

  img {
    width: 100%;
    height: 50px;
    display: block;
  }
  .h-top {
    width: 100%;
    #chahao {
      width: 28px;
      height: 28px;
      position: absolute;
      top: 18px;
      left: 8px;
    }
  }
  .h-con {
    width: 100%;
    height: 100px;
    background-color: rgb(255, 219, 71);
    padding: 0 5px;
    box-sizing: border-box;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    .head-left,
    .head-right {
      width: 50px;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 10px;
    }
    .head-conter {
      width: 260px;
      margin-top: 10px;
      img {
        width: 100%;
        height: 30px;
      }
    }
    .head-bottom {
      margin-top: 5px;
      width: 350px;
      height: 38px;
      margin: 0 auto;
      border-radius: 19px;
      background-color: #fff;
      color: #666;
      display: flex;
      align-items: center;
      .iconfont {
        margin: 0 8px;
      }
    }
  }
}
</style>
